<#assign spring=JspTaglibs["http://www.springframework.org/tags"] />
<#assign sec=JspTaglibs["http://www.springframework.org/security/tags"] />


<html>
    <head>
        <title>Login</title>
    </head>
    <body>
<div class="test">
           <@sec.authorize access="isAnonymous()">
		        <h3>Please enter your username and password.</h3>
		
		        <#if error??>
      			    <p class="error">Your login attempt was not successful, try again.</p>
		        </#if>
		
	    	    <p id="userWarning" class="error" style="display:none">The given username does not exist.</p>
		
    		    <form action="/submit" method="post">
		    	      <table>
    		    	      <tr><td>Username:</td>
    		    	      <#if error??>
    		    	       <td><input type="text" name="username" value=""/></td></tr>
    		    	      <#else>
    		    	       <td><input type="text" name="username" value="${SPRING_SECURITY_LAST_USERNAME!}"></td></tr>
    		    	      </#if>
    		    	     
    			          <tr><td>Password:</td>
    			          <td><input type="password" name="password" /></td></tr>
        			      <tr><td>Remember me:</td>
        			      <td><input type="checkbox" name="remember_me" /></td></tr>
        			      <tr><td><input name="reset" type="reset" value="Reset" /></td>
        			      <td><input name="submit" type="submit" value="Submit" /></td></tr>
      			    </table>
		        </form>
		
		        <p>Need to create an account? Click <a href="/create">here</a>.</p>
		    
		</@sec.authorize>
        <@sec.authorize access="isAuthenticated()">
            <p>Already logged in. Please click <a href="/logout">here</a> to logout.</p>
        </@sec.authorize>
</div>
 </body>
</html>
